cmake_minimum_required(VERSION 3.8)
project(test_package LANGUAGES CXX)

enable_testing()

find_package(ApprovalTests REQUIRED CONFIG)

if(WITH_BOOSTTEST)
    add_executable(test_package_boosttest test_boosttest.cpp)
    target_link_libraries(test_package_boosttest PRIVATE ApprovalTests::ApprovalTests)
    target_compile_features(test_package_boosttest PRIVATE cxx_std_11)
    add_test(NAME test_package_boosttest COMMAND test_package_boosttest)
endif()
if(WITH_CATCH)
    add_executable(test_package_catch test_catch.cpp)
    target_link_libraries(test_package_catch PRIVATE ApprovalTests::ApprovalTests)
    target_compile_features(test_package_catch PRIVATE cxx_std_11)
    add_test(NAME test_package_catch COMMAND test_package_catch)
endif()
if(WITH_GTEST)
    add_executable(test_package_gtest test_gtest.cpp)
    target_link_libraries(test_package_gtest PRIVATE ApprovalTests::ApprovalTests)
    target_compile_features(test_package_gtest PRIVATE cxx_std_11)
    add_test(NAME test_package_gtest COMMAND test_package_gtest)
endif()
if(WITH_DOCTEST)
    add_executable(test_package_doctest test_doctest.cpp)
    target_link_libraries(test_package_doctest PRIVATE ApprovalTests::ApprovalTests)
    target_compile_features(test_package_doctest PRIVATE cxx_std_11)
    add_test(NAME test_package_doctest COMMAND test_package_doctest)
endif()
if(WITH_CPPUTEST)
    add_executable(test_package_cpputest test_cpputest.cpp)
    target_link_libraries(test_package_cpputest PRIVATE ApprovalTests::ApprovalTests)
    target_compile_features(test_package_cpputest PRIVATE cxx_std_11)
    add_test(NAME test_package_cpputest COMMAND test_package_cpputest)
endif()

add_executable(test_package test_package.cpp)
target_link_libraries(test_package PRIVATE ApprovalTests::ApprovalTests)
target_compile_features(test_package PRIVATE cxx_std_11)
add_test(NAME test_package COMMAND test_package)
